#pragma once
#include "narchive.hpp"
#include "archive/zip/unzip/unzip.h"

class NZipArchive :
    public NArchive
{
public:
    NZipArchive(void);
    NZipArchive(const char *filename);
    NZipArchive(const wchar_t *filename);
    virtual ~NZipArchive(void);
public:
    bool open(const char *filename);
    bool open(const wchar_t *filename);
    void close();
    bool isopen() const;
    size_t filelist(std::vector<NArchiveFile> &flist);
    int extract(NArchiveFile& naf);
    bool issupport(const char* filename) const;
    bool issupport(const wchar_t* filename) const;
private:
    unzFile _uf;
    //bool _open(char* fn, wchar_t* wfn);
    bool _issupport(const char* fn, const wchar_t* wfn) const;
};
